package com.ruoyi.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.OperateBasicForm;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysDepartmentRoleMapper;
import com.ruoyi.system.domain.SysDepartmentRole;
import com.ruoyi.system.service.ISysDepartmentRoleService;

/**
 * 统一门户部门和子系统角色关联Service业务层处理
 *
 * @author sunye
 * @date 2024-10-10
 */
@Service
public class SysDepartmentRoleServiceImpl extends ServiceImpl<SysDepartmentRoleMapper, SysDepartmentRole> implements ISysDepartmentRoleService
{
    @Autowired
    private SysDepartmentRoleMapper sysDepartmentRoleMapper;

    /**
     * 查询统一门户部门和子系统角色关联
     *
     * @param id 统一门户部门和子系统角色关联主键
     * @return 统一门户部门和子系统角色关联
     */
    @Override
    public SysDepartmentRole selectSysDepartmentRoleById(Long id)
    {
        return sysDepartmentRoleMapper.selectSysDepartmentRoleById(id);
    }

    /**
     * 查询统一门户部门和子系统角色关联列表
     *
     * @param sysDepartmentRole 统一门户部门和子系统角色关联
     * @return 统一门户部门和子系统角色关联
     */
    @Override
    public List<SysDepartmentRole> selectSysDepartmentRoleList(SysDepartmentRole sysDepartmentRole)
    {
        return sysDepartmentRoleMapper.selectSysDepartmentRoleList(sysDepartmentRole);
    }

    /**
     * 新增统一门户部门和子系统角色关联
     *
     * @param sysDepartmentRole 统一门户部门和子系统角色关联
     * @return 结果
     */
    @Override
    public int insertSysDepartmentRole(SysDepartmentRole sysDepartmentRole)
    {
        return sysDepartmentRoleMapper.insert(sysDepartmentRole);
    }

    /**
     * 修改统一门户部门和子系统角色关联
     *
     * @param sysDepartmentRole 统一门户部门和子系统角色关联
     * @return 结果
     */
    @Override
    public int updateSysDepartmentRole(SysDepartmentRole sysDepartmentRole)
    {
        return sysDepartmentRoleMapper.updateById(sysDepartmentRole);
    }

    /**
     * 批量删除统一门户部门和子系统角色关联
     *
     * @param ids 需要删除的统一门户部门和子系统角色关联主键
     * @return 结果
     */
    @Override
    public int deleteSysDepartmentRoleByIds(Long[] ids)
    {
        return sysDepartmentRoleMapper.deleteSysDepartmentRoleByIds(ids);
    }

    /**
     * 删除统一门户部门和子系统角色关联信息
     *
     * @param id 统一门户部门和子系统角色关联主键
     * @return 结果
     */
    @Override
    public int deleteSysDepartmentRoleById(Long id)
    {
        return sysDepartmentRoleMapper.deleteSysDepartmentRoleById(id);
    }

/**
 * 置为有效/无效统一门户部门和子系统角色关联
 *
 */
@Override
public int effectiveStatus(OperateBasicForm operateBasicForm)
{
    return sysDepartmentRoleMapper.effectiveStatus(operateBasicForm);
}

    @Override
    public Integer selectDepartmentByRoleId(Long roleId) {
        return sysDepartmentRoleMapper.selectDepartmentByRoleId(roleId);
    }
}
